-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix regression where some CLI commands break on Ruby 1.8 #7738
Conversation
First of all, hello and welcome @claui 👋 😀 And second - wow great work researching and documenting this issue!
I suspect this is the case because As a nitpick - I generally lean towards a bit more verbosity in the commit message. There's great documentation work done here in the PR, but it would be more difficult for our Future Selves running So 👍 from me - happy to have you on the team! |
Those PRs are just me not realizing that |
Thank you @rolandwalker for clarifying this. |
Yeah we will probably never drop the dependency on rubygems - we're mostly just focused on killing the dependency on homebrew code (see #5080). FWIW I think keeping the requires closer to the |
+1 for merge as-is. I did the same in |
Fix regression where some CLI commands break on Ruby 1.8
This fixes a regression where for example,
brew cask list
would break on Ruby 1.8.7.Cause
I feel the regression might have been introduced in the merge commit 62c1ce5, which adds code to
path_base.rb
which depends onGem::Version
, but doesn’t require therubygems
gem.A Google search showed that
rubygems
is built into 1.9 and later but not into 1.8 (I learn something new every day!). This seems to causebrew cask list
(and other commands) to break under Ruby 1.8 since 62c1ce5.Steps to reproduce
Assuming
rbenv
and Ruby 1.8.7-p375 are installed, follow these steps:brew cask list
under Ruby 1.8 like so:Result
CLI::Alfred
CLI::Alfred
class (since 0f664ca). That commit has been around since 0.41.1 so I guess it doesn’t cause any issues after all. I couldn’t produce any problem with this either but I added the missingrequire
here as well just in case.Test coverage
Given that
brew cask list
breaks, I would have expectedlist_test.rb
to break as well. However, for some strange reason all the unit tests are still green:Strangely, the result is:
Please review
Pinging one of @federicobond @ndr-qef @phinze @rolandwalker to please have a look. 😊
Thank you!